const goodsServie = require('../service/goodsService');
require('../db.js');

// let aa = { type: "name", value: "双人床", adminId: "60c44a238e82cb0be43a584f" };

// async function main(aaa) {
//     let { type, value, current, size, adminId } = aaa;
//     let searchObj = {};
//     if (type && type === "_id") {
//         searchObj[type] = value
//     } else if (type) {
//         searchObj[type] = { $regex: value }
//     }
//     adminId ? searchObj.adminId = adminId : ""
//     let data = await goodsServie.find(searchObj, { current: ~~current || 1, size: ~~size || 5 })
//     console.log(data);
// }
// main(aa);
console.log(123);


let bb = "60c4455b8e82cb0be43a5846";
async function main(aaa) {
    let data = await goodsServie.findAll(aaa)
    console.log(data);
    console.log(data.length);
}
main(bb);
